const strChrt = ([...str]) => {
    let list = str.reduce((pre, cur) => {
        if (cur in pre) {
            pre[cur] += 1
        } else {
            pre[cur] = 1
        }
        return pre
    }, {})
    let king = Object.keys(list).reduce((pre, cur) => {
        if (list[cur] > list[pre]) {
            return cur
        } else {
            return pre
        }
    })
    return king
};
const deepClone = (objs) => {
    var obj2 = JSON.parse(JSON.stringify(objs))

    obj2[0].childs = []
    return obj2
}
module.exports = {strChrt,deepClone}